<div class="panel panel-default" style=" ">
	<ul class="nav nav-tabs" style="margin-top: 5px;padding-left: 10px;">
	
		<li class="{if (empty($rd) || $rd=='index')}active{/if}">
		<a href="{php echo $this->createWebUrl('option', array('op' => $operation))}"> 管理</a></li>
		<li  class="{if ( $rd=='add')}active{/if}">
		<a href="{php echo $this->createWebUrl('option', array('op' => $operation,'rd'=>'add'))}">新增 </a></li>
	
	</ul>	
         <div class="panel-body"> 

    <form action="" method="post" class="article-post form-horizontal form">
        <input type="hidden" name="parentid" value="{$parent['id']}" />
        <input type="hidden" name="id" value="{$id}" />
        <div class=" ">
         
             
            <div class="form-group">
                <label for="" class="control-label col-sm-2"> 名称：</label>
                <div class="form-controls col-sm-8">
                  <input type="text" name="cname" class="form-control" value="{$category['fname']}" />
                     
                </div>
            </div>            
            <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">图标1：</label>
                        <div class="form-controls col-sm-8 col-xs-12">	
                         {php echo tpl_form_field_image('thumb', $category['thumb'], '', array('extras' => array('text' => 'readonly')))}
                           
                        </div>	
                    </div>	

            {if $operation=='btbar'}
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 control-label">图标2(选中时)：</label>
                <div class="form-controls col-sm-8 col-xs-12">	
                    {php echo tpl_form_field_image('thumb_active', $category['thumb_active'], '', array('extras' => array('text' => 'readonly')))}
                    
                </div>	
            </div>	
            {/if}

                <div class="form-group">
                <label for="" class="control-label col-sm-2">导航链接：</label>
                <div class="form-controls col-sm-8">
                    <div>
                        <input type="text" name="description" class="form-control" value="{php echo urldecode($category['desc']) }" />     
                    </div>
                    <div>
                        
                        <select onchange="setlinkurl(this)">
                            <option value="">-请选择-</option>
                            {loop $siteLinks $link} 
                            <option value="{$link['pathurl']}">{$link['name']}</option>
                            {/loop}
                        </select>
                        <label>选择一个页面链接 </label>
                    </div> 
                </div>
            </div>
            <div class="form-group">
                <label for="" class="control-label col-sm-2">链接跳转方式：</label>
                <div class="form-controls col-sm-8">
                 {php  echo form_element::select($open_target, 'islink', 'islink' ,$category['islink'] )}
                 <span class="help-block">
                    
                 </span>    
                </div>
            </div>
            
 
            <div class="form-group">
                <label for="" class="control-label col-sm-2">菜单ID：</label>
                <div class="form-controls col-sm-8">
                                 <input type="text" name="displayorder" class="form-control" value="{$category['orderid']}" />
                     
                    <span class="help-block">填写ID表示替换第几个菜单，从0开始计数 </span>
                </div>
            </div>
        
         
            <div class="form-group">
                <label for="" class="control-label col-sm-2">是否启用：</label>
                <div class="form-controls col-sm-8">
                    <input id='enabled1' type="radio" name='enabled' value="1" {if $category['disabled']==1}checked{/if}/>
                    <label for="enabled1">否</label>
                    <input id='enabled2' type="radio" name='enabled' value="0"  {if $category['disabled']==0}checked{/if}/>
                    <label for="enabled2">是</label>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label for="" class="control-label col-sm-2"> </label>
                <div class="form-controls col-sm-8">
                    <input type="hidden" name="token" value="{$_W['token']}" />
                    <input name="submit" value="发布" class="btn btn-primary btn-submit" type="submit">
                    </div>
                
                </div>
        
        </div>
    </form>
    </div>
    </div>
</div>
    <script>
        function setlinkurl(obj){
            $("input[name='description']").val(obj.value)
        }
    </script>